<template>
      <el-container style="height: 100%">
            <div style="text-align: center;background-color: #f1f1f3; left: 10px">
                  <h1 style="font-size: 50px; background-color:white;margin-top: 80px">{{ '欢迎您！' + user.account }}</h1>
                  <el-descriptions :column="2" border style="text-align: center">
                        <el-descriptions-item>
                              <template slot="label">
                                    <i class="el-icon-s-custom"> 账号</i>
                              </template>
                              {{ user.card }}
                        </el-descriptions-item>
                        <el-descriptions-item>
                              <template slot="label">
                                    <i class="el-icon-mobile-phone"></i>
                                    电话
                              </template>
                              {{ user.phone }}
                        </el-descriptions-item>
                        <el-descriptions-item>
                              <template slot="label">
                                    <i class="el-icon-location-outline"></i>
                                    性别
                              </template>
                              <el-tag :type="user.sex === '1' ? 'primary' : 'danger'" disable-transitions><i
                                        :class="user.sex==1?'el-icon-male':'el-icon-female'"></i>{{ user.sex == 1 ? "男" : "女" }}
                              </el-tag>
                        </el-descriptions-item>
                        <el-descriptions-item>
                              <template slot="label">
                                    <i class="el-icon-tickets"></i>
                                    角色
                              </template>
                              <el-tag
                                        disable-transitions
                                        type="success">
                                    {{ user.state == 0 ? "管理员" : (user.roleId == 1 ? "用户" : "律师") }}
                              </el-tag>

                        </el-descriptions-item>
                  </el-descriptions>

                  <DateUtils style="margin-top: 50px"/>
            </div>
      </el-container>
</template>

<script>
import DateUtils from "../DateUtils.vue";

export default {
      name: "adminMain",
      components: {DateUtils},
      data() {

            return {
                  user: {}
            }
      },
      computed: {},
      methods: {
            init() {
                  this.user = JSON.parse(sessionStorage.getItem('CurUser'))
                  console.log(JSON.parse(sessionStorage.getItem('CurUser')))
            }
      },
      created() {
            this.init()
      }
}
</script>

<style scoped>
.el-descriptions {
      width: 90%;

      margin: 0 auto;
      text-align: center;
}
</style>